﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="search_one_select_course.aspx.cs" Inherits="search_one_select_course" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>查询指定学生的选课信息</title>
    <style type="text/css">
        .auto-style1 {
            font-size: x-large;
        }
        .auto-style3 {
            font-size: large;
        }
        .auto-style4 {
            text-align: center;
        }
        .auto-style5 {
            font-size: large;
            font-weight: 700;
        }
    </style>
</head>
<body class="auto-style4">
    <form id="form1" runat="server">
        <span class="auto-style1"><strong>
        <br />
        查询指定学生选课信息<br />
        <br />
        </strong></span><span class="auto-style3">请输入要查询的学生的学号：</span><asp:TextBox ID="TextBox1" runat="server" CssClass="auto-style3" Height="16px" Width="191px"></asp:TextBox>
        <br class="auto-style3" />
        <br />
        <asp:Button ID="Button1" runat="server" CssClass="auto-style5" Height="33px" Text="查询" Width="73px" />
        <br />
        <br />

        <center>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="Sno,Cno" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="Sno" HeaderText="学号" ReadOnly="True" SortExpression="Sno" />
                <asp:BoundField DataField="Cno" HeaderText="课程号" ReadOnly="True" SortExpression="Cno" />
                <asp:BoundField DataField="Cname" HeaderText="课程名" SortExpression="Cname" />
                <asp:BoundField DataField="teacher" HeaderText="授课教师" SortExpression="teacher" />
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
            </center>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString2 %>" SelectCommand="SELECT Select_course.Sno, Select_course.Cno, Course.Cname, Course.teacher FROM Select_course INNER JOIN Course ON Select_course.Cno = Course.Cno WHERE (Select_course.Sno = @Sno)">
            <SelectParameters>
                <asp:ControlParameter ControlID="TextBox1" Name="Sno" PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
    </form>
</body>
</html>
